<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>测评结果</title>
    <!--[if lt IE 9]>
        <script src="bower_components/html5shiv/dist/html5shiv.js"></script>
        <script type="text/javascript" src="{{asset('/default/js/personal/excanvas.js')}}"></script>
    <![endif]-->
    <link rel="stylesheet" href="{{asset('/default/css/public.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/personal/apmReport.css')}}">
    <link rel="stylesheet" href="{{asset('/default/css/index/index_head_foot.css')}}">
    {{--添加样式表--}}
    @yield('insert_css')
</head>
<body>
{{--头部顶端--}}
@include('default.layouts.head')
{{--导航--}}
<div class="mainNav">
    <div class="wrapper">
        <h1 class="logo">
            <a href="{{url('/')}}">
                <img src="{{asset('default/images/logo/index.png')}}">
            </a>
        </h1>
        @if(!empty($menuNav))
            <ul>
                <li><a href="{{url('/')}}">首页</a></li>
                @foreach($menuNav as $v)
                    @if($v->nav_url == 'personnel')
                        <li><a href="{{url($v->nav_url.'?havedetails=9')}}">{{$v->nav_name}}</a></li>
                    @else
                        <li><a href="{{url($v->nav_url)}}">{{$v->nav_name}}</a></li>
                    @endif
                @endforeach
            </ul>
        @endif
    </div>
</div>

@section('content')
    <div class="main">
        <div class="wrapper">
            <h2 class="title">{{current($activityList)['con']->dim_name}}评测报告</h2>
            {{--基本信息--}}
            <div class="baseInfo">
                {{--综合得分，下载按钮--}}
                <div class="score">
                    <input type="hidden" name="totalScore" data-total-score="{{$apm->total_score}}">
                    <span class="title">综合得分：{{$apm->total_score}}</span>
                    <ul class="stars"><li></li><li></li><li></li><li></li><li></li></ul>
                    <a class="download" href="{{$apm->report_url}}">下载PDF版详细评测报告</a>
                </div>
                <ul class="info">
                    <li><span>姓 名<i></i></span>：{{$resume->name}}</li>
                    <li><span>性 别<i></i></span>：{{$resume->sex==1?'男':'女'}}</li>
                    <li><span>出生日期</span>：{{$resume->birthday}}</li>
                    {{--<li><span>学 历：</span></li>--}}
                    <li><span>意向岗位</span>：{{$resume->intentionjobs}}</li>
                    <li><span>电子邮箱</span>：{{$resume->email}}</li>
                    <li><span>测评日期</span>：{{date('Y-m-d',strtotime($apm->created_at))}}</li>
                </ul>
            </div>
            <div class="details">
                @foreach($activityList as $key => $value)
                    @foreach($value['son'] as $key2 => $value2)
                        <div class="box">
                            <div class="title"><em class="dashedLine"></em><strong>{{$value2['con']->dim_name}}</strong></div>
                            <div class="pie">
                                <input type="hidden" name="name" value="{{$value2['con']->dim_name}}" data-id="{{$key2}}">
                                <input type="hidden" name="val" value="{{$value2['con']->dim_score}}">
                                <div id = "myChart{{$key2}}" class="myChart"></div>
                                <div class="score">{{$value2['con']->dim_score}}</div>
                                <div class="legend"><i class="color1"></i><span>总分：5</span><i class="color2"></i><span>我的得分：{{$value2['con']->dim_score}}</span></div>
                            </div>
                            <table>
                                <?php $i = 0 ?>
                                @foreach($value2['son'] as $key3 => $value3)
                                    <tr>
                                        @if($i == 0)
                                            <td class="tds" rowspan="{{count($value2['son'])}}">{{$value2['con']->dim_name}}</td>
                                            <td class="tds" rowspan="{{count($value2['son'])}}">{{$value2['con']->dim_score}}</td>
                                            <?php $i++ ?>
                                        @endif
                                        <td>{{$value3['con']->dim_name}}</td>
                                        <td class="b">{{$value3['con']->dim_score}}</td>
                                        {{--@foreach($value3['son'] as $key4 => $value4)--}}
                                        {{--{{$value4['con']->dim_name}}{{$value4['con']->dim_score}}--}}
                                        {{--@endforeach--}}
                                    </tr>
                                @endforeach
                            </table>
                        </div>
                    @endforeach
                @endforeach
            </div>
        </div>
    </div>
@show

{{--尾部网站地图--}}
<div class="bottomnav">
    <div class="center">
        <div class="con">
            @include('default.layouts.simple_footer')
        </div>
    </div>
</div>
@section('js')
    <script type="text/javascript" src="{{asset('/default/js/jquery.js')}}"></script>
    <script type="text/javascript" src="{{asset('/orange/js/public.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/head.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/echarts.min.js')}}"></script>
    <script type="text/javascript">
        $(function(){
            var len = $('.myChart').length; //总共需要创建饼图数
            for(var i = 0; i < len; i++){
                //获取value值
                //创建绘制图表
                var canvasId = 'myChart' + $('.myChart').eq(i).siblings('input[name=name]').attr('data-id');
                var name = $('.myChart').eq(i).siblings('input[name=name]').val();
                var value = $('.myChart').eq(i).siblings('input[name=val]').val();
                //初始化
                var myChart = echarts.init(document.getElementById(canvasId));
                // 指定图表的配置项和数据
                option = {
                    series: [
                        {
                            name:'访问来源',
                            type:'pie', //图表类型
                            color:['#999','#f2504e'], //图表颜色
                            radius: ['80%', '100%'], //圆环大小
                            hoverAnimation: false, //鼠标移上动画效果
                            hoverable: false, //
                            avoidLabelOverlap: false,
                            labelLine: {
                                normal: {
                                    show: false
                                }
                            },
                            data:[
                                {value:5 - value, name:'未达到'},
                                {value:value, name:name}
                            ]
                        }
                    ]
                };
                //创建图表
                myChart.setOption(option);
            }

            //星星高亮(0-0.5空星，0.5-1半星，整数实星)
            var totalScore = $("input[name=totalScore]").attr('data-total-score');
            var allStars = $('.baseInfo .stars li');
            var allStarNum = parseInt(totalScore); //实心星星个数
            if(totalScore - allStarNum > 0.5){
                var halfStarIndex = allStarNum; //显示为半颗星的位置下标
            }
            for(var i = 0; i< allStarNum; i++){
                allStars.eq(i).addClass('all');
            }
            allStars.eq(halfStarIndex).addClass('half');
        });
    </script>
@show

